package sjtu.rfid.rri.services.ale;

import java.util.List;

import javax.jws.WebService;

import sjtu.rfid.rri.services.ale.exception.CCSpecValidationException;
import sjtu.rfid.rri.services.ale.exception.DuplicateNameException;
import sjtu.rfid.rri.services.ale.exception.DuplicateSubscriptionException;
import sjtu.rfid.rri.services.ale.exception.ImplementationException;
import sjtu.rfid.rri.services.ale.exception.InvalidURIException;
import sjtu.rfid.rri.services.ale.exception.NoSuchNameException;
import sjtu.rfid.rri.services.ale.exception.NoSuchSubscriberException;
import sjtu.rfid.rri.services.ale.exception.ParameterException;
import sjtu.rfid.rri.services.ale.exception.ParameterForbiddenException;
import sjtu.rfid.rri.services.ale.writing.AssocTableEntryList;
import sjtu.rfid.rri.services.ale.writing.AssocTableSpec;
import sjtu.rfid.rri.services.ale.writing.CCParameterList;
import sjtu.rfid.rri.services.ale.writing.CCReports;
import sjtu.rfid.rri.services.ale.writing.CCSpec;
import sjtu.rfid.rri.services.ale.writing.EPCCacheSpec;
import sjtu.rfid.rri.services.ale.writing.EPCPatternList;
import sjtu.rfid.rri.services.ale.writing.RNGSpec;

@WebService
public interface ALECC {
	void define(String specName, CCSpec spec) throws DuplicateNameException,
			CCSpecValidationException, SecurityException,
			ImplementationException;

	void undefine(String specName) throws NoSuchNameException,
			SecurityException, ImplementationException;

	CCSpec getCCSpec(String specName) throws NoSuchNameException,
			SecurityException, ImplementationException;

	List<String> getCCSpecNames() throws SecurityException,
			ImplementationException;

	void subscribe(String specName, String notificationURI)
			throws NoSuchNameException, InvalidURIException,
			DuplicateSubscriptionException, ParameterForbiddenException,
			SecurityException, ImplementationException;

	void unsubscribe(String specName, String notificationURI)
			throws NoSuchNameException, NoSuchSubscriberException,
			InvalidURIException, SecurityException, ImplementationException;

	CCReports poll(String specName, CCParameterList params)
			throws NoSuchNameException, ParameterException, SecurityException,
			ImplementationException;

	CCReports immediate(CCSpec spec) throws CCSpecValidationException,
			ParameterForbiddenException, SecurityException,
			ImplementationException;

	List<String> getSubscribers(String specName) throws NoSuchNameException,
			SecurityException, ImplementationException;

	/** *************** EPCCache ************ */

	void defineEPCCache(String cacheName, EPCCacheSpec spec,
			EPCPatternList replenishment);

	EPCPatternList undefineEPCCache(String cacheName);

	EPCCacheSpec getEPCCache(String cacheName);

	List<String> getEPCCacheNames();

	void replenishEPCCache(String cacheName, EPCPatternList replenishment);

	EPCPatternList depleteEPCCache(String cacheName);

	EPCPatternList getEPCCacheContents(String cacheName);

	/** *************** Association Table ************ */

	void defineAssocTable(String tableName, AssocTableSpec spec,
			AssocTableEntryList entries);

	void undefineAssocTable(String tableName);

	List<String> getAssocTableNames();

	AssocTableSpec getAssocTable(String tableName);

	void putAssocTableEntries(String tableName, AssocTableEntryList entries);

	String getAssocTableValue(String tableName, String epc);

	AssocTableEntryList getAssocTableEntries(String tableName,
			EPCPatternList patList);

	void removeAssocTableEntry(String tableName, String epc);

	void removeAssocTableEntries(String tableName, EPCPatternList patList);

	void defineRNG(String rngName, RNGSpec rngSpec);

	void undefineRNG(String rngName);

	List<String> getRNGNames();

	RNGSpec getRNG(String rngName);

	String getStandardVersion() throws ImplementationException;

	String getVendorVersion() throws ImplementationException;
}
